import request from '@/utils/request'

//课程列表   请求后端
export default {
    //发送添加课程请求
    addCourseList(courseInfo) {
        return request({
            url: `/eduservice/educourse/saveCourse`,
            method: 'post',
            data: courseInfo
        })
    },
    //发送教师列表请求
    getTeachers() {
        return request({
            url: `/eduservice/teacher/findAll`,
            method: 'get'
        })
    },
    //根据课程id查询课程基本信息
    getCourseInfoById(id){
        return request({
            url: `/eduservice/educourse/courseinfo/`+id,
            method: 'get'
        })
    },
    //根据课程id查询课程基本信息
    updateCourseInfoId(courseInfo){
        return request({
            url: `/eduservice/educourse/updatecourseinfo`,
            method: 'post',
            data:courseInfo
        })
    },
    //课程确认信息显示
    getPublishCourseInfo(courseId){
        return request({
            url: `/eduservice/educourse/getPublishCourseInfo/`+courseId,
            method: 'get'
        })
    },
    //课程确认信息发布
    PublishCourse(courseId){
        return request({
            url: `/eduservice/educourse/publicCourse/`+courseId,
            method: 'post'
        })
    },
    //课程列表
    getListCourse() {
        return request({
            url: '/eduservice/educourse/queryall',
            method: 'get'
          })
    },
    //删除课程
    deleteCourseById(courseId) {
        return request({
            url: '/eduservice/educourse/'+courseId,
            method: 'delete'
          })
    }

    
}




//默认写法
// export function getList(params) {
//   return request({
//     url: '/table/list',
//     method: 'get',
//     params
//   })
// }